import os

import pytest

from tartiflette.language.ast import (
    DirectiveDefinitionNode,
    DocumentNode,
    InputValueDefinitionNode,
    Location,
    NamedTypeNode,
    NameNode,
    StringValueNode,
)
from tartiflette.language.parsers.lark import parse_to_document

_STRING_VALUE_SDL_DIR = os.path.join(
    os.path.dirname(__file__), "fixtures", "strings"
)


@pytest.mark.parametrize(
    "sdl_filename,expected",
    [
        (
            "empty_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=24,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=24
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "single_word_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="Deprecated",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=34,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=34
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "sentence_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No longer supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=43,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=43
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "unicode_char_1_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No ģ supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=43,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=43
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "unicode_char_2_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No ꯍ supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=43,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=43
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "unicode_char_3_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \u05fd supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=43,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=43
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "escaped_quote_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value='No " supported',
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "escaped_back_slash_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \\ supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "escaped_slash_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No / supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "b_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \x08 supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "f_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \x0c supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "n_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \n supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "r_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \r supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "t_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \t supported",
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=39,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=39
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
        (
            "all_in_string_value.graphql",
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=1, column=12, line_end=1, column_end=22
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=2,
                                        column=5,
                                        line_end=2,
                                        column_end=11,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=2,
                                            column=13,
                                            line_end=2,
                                            column_end=19,
                                        ),
                                    ),
                                    location=Location(
                                        line=2,
                                        column=13,
                                        line_end=2,
                                        column_end=19,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value='No \u05fd ꯍ ģ \t \r \n \x0c / " \\ \x08 supported',
                                    location=Location(
                                        line=2,
                                        column=22,
                                        line_end=2,
                                        column_end=81,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=2, column=5, line_end=2, column_end=81
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=3, column=6, line_end=3, column_end=22
                                ),
                            )
                        ],
                        location=Location(
                            line=1, column=1, line_end=3, column_end=22
                        ),
                    )
                ],
                location=Location(line=1, column=1, line_end=3, column_end=22),
            ),
        ),
    ],
)
def test_lark_parsed_string_value_from_file(sdl_filename, expected):
    with open(os.path.join(_STRING_VALUE_SDL_DIR, sdl_filename)) as sdl_file:
        assert parse_to_document(sdl_file.read()) == expected


@pytest.mark.parametrize(
    "sdl,expected",
    [
        (
            """
            directive @deprecated(
                reason: String = ""
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=36,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=36,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "Deprecated"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="Deprecated",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=46,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=46,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No longer supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No longer supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=55,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=55,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\u0123 supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No ģ supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=55,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=55,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\uabcd supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No ꯍ supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=55,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=55,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\u05fd supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \u05fd supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=55,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=55,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\" supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value='No " supported',
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\\\ supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \\ supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\/ supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No / supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\b supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \x08 supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\f supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \x0c supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\n supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \n supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\r supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value="No \r supported",
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=51,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=51,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
        (
            """
            directive @deprecated(
                reason: String = "No \\u05fd \\uabcd \\u0123 \\t \\r \\n \\f \\/ \\" \\\\ \\b supported"
            ) on FIELD_DEFINITION
            """,
            DocumentNode(
                definitions=[
                    DirectiveDefinitionNode(
                        description=None,
                        name=NameNode(
                            value="deprecated",
                            location=Location(
                                line=2, column=24, line_end=2, column_end=34
                            ),
                        ),
                        arguments=[
                            InputValueDefinitionNode(
                                description=None,
                                name=NameNode(
                                    value="reason",
                                    location=Location(
                                        line=3,
                                        column=17,
                                        line_end=3,
                                        column_end=23,
                                    ),
                                ),
                                type=NamedTypeNode(
                                    name=NameNode(
                                        value="String",
                                        location=Location(
                                            line=3,
                                            column=25,
                                            line_end=3,
                                            column_end=31,
                                        ),
                                    ),
                                    location=Location(
                                        line=3,
                                        column=25,
                                        line_end=3,
                                        column_end=31,
                                    ),
                                ),
                                default_value=StringValueNode(
                                    value='No \u05fd ꯍ ģ \t \r \n \x0c / " \\ \x08 supported',
                                    location=Location(
                                        line=3,
                                        column=34,
                                        line_end=3,
                                        column_end=93,
                                    ),
                                ),
                                directives=[],
                                location=Location(
                                    line=3,
                                    column=17,
                                    line_end=3,
                                    column_end=93,
                                ),
                            )
                        ],
                        locations=[
                            NameNode(
                                value="FIELD_DEFINITION",
                                location=Location(
                                    line=4,
                                    column=18,
                                    line_end=4,
                                    column_end=34,
                                ),
                            )
                        ],
                        location=Location(
                            line=2, column=13, line_end=4, column_end=34
                        ),
                    )
                ],
                location=Location(
                    line=2, column=13, line_end=4, column_end=34
                ),
            ),
        ),
    ],
)
def test_lark_parsed_string_value_from_string(sdl, expected):
    assert parse_to_document(sdl) == expected
